<?php

namespace app\index\service;

use app\index\service\ranks\RankInterface;

/**
 * 律师排行榜
 * Class LawyerRankService
 * @package app\index\service
 */
class LawyerRankService
{
    /**
     * 进行某排行榜排序
     * @param $rankType
     * @return void
     */
    public function rank($rankType): void
    {
        $impl = $this->getRankImpl($rankType);
        if ($impl) {
            $impl->rank();
        }
    }

    private function getRankImpl($rankType): ?RankInterface
    {
        return app_instance(RankInterface::class, $rankType, '', 'Rank');
    }
}
